package com.springtest;

import com.spring.dao.UserDao;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class testUser {

    @Test
    public void testSave() throws Exception {
        //ClassPathXmlApplicationContext ClassPathXmlApplicationContext=new ClassPathXmlApplicationContext("application.xml");
        //UserDao userDao = (UserDao) ClassPathXmlApplicationContext.getBean("UserDao");
        //ClassPathXmlApplicationContext.close();
        //userDao.saveInfo();
        //UserDao userDao1 = (UserDao) applicationContext.getBean("UserDao1");
        //System.out.println(userDao==userDao);
        //System.out.println(userDao);
        //System.out.println(userDao1);
       ApplicationContext applicationContext  =new  ClassPathXmlApplicationContext("application.xml");
        UserDao userDao =(UserDao) applicationContext.getBean("staticFactory");
        userDao.print();

    }

}
